package org.example.rabbitmqspring.listener;

import org.example.rabbitmqspring.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectListener {
    @RabbitListener(queues = Constants.DIRECT_QUEUE1)
    public void directListener1(String message) {
        System.out.println("消费者" + "directListener1" + "路由模式消费的消息: " + message);
    }
    @RabbitListener(queues = Constants.DIRECT_QUEUE2)
    public void directListener2(String message) {
        System.out.println("消费者" + "directListener2" + "路由模式消费的消息: " + message);
    }
}
